<?php
namespace app\taobao\command;
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/6
 * Time: 17:59
 */
use think\console\Command;
use think\console\Input;
use think\console\Output;
use app\common\model\Menu as MenuModel;
use \Redis;
use think\exception\ErrorException;
use think\image\Exception;
use think\Request;

class Test extends Command{

    protected function configure(){
        $this->setName('test')->setDescription("ceshi");
    }

    /**
     * 香草可可
    Luna meng
    黛安芬
    予含
    ERFS
    鄂尔多斯
    暴龙
    miu
    网极
    CAPDASE
    nike
    adidas
     * @param Input $input
     * @param Output $output
     */
    protected function execute(Input $input,Output $output ){
        //标题处理
        $command = '';
        $command = 'python ../work/filterWords.py --title="abc" --type=brand --type=stopword';
        //$encode = mb_detect_encoding($command, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
        //echo $encode;exit;
        $command = mb_convert_encoding($command,'gbk','utf-8');
        if($command){
            $res = shell_exec($command);
            if($res) {
                echo $res;
                file_put_contents('aa.txt',$res);
            }
            else echo 'nothing';
        }

        //$output->writeln($res);

    }


}

